package com.example.j20240313springmvc.mapper;

import com.example.j20240313springmvc.model.Message;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MessageMapper {
    @Insert("insert into message_info (`from`, `to`, `message`) values (#{from}, #{to}, #{say})")
    Integer insertMessage(Message message);

    @Result(column = "message", property = "say")
    @Select("select * from message_info where delete_flag = 0")
    List<Message> SelectAllMessage();
}
